#include "stdio.h"
#include "stdlib.h"
typedef unsigned char *byte_pointer;
typedef unsigned int uint;
int is_little_endian(void)
{
    uint x = 0x55aa;
    byte_pointer start = (byte_pointer)&x;
    if((start[0] == 0x55) && (start[1] == 0xaa))
    {
        printf("0x55aa stored like this:0x%x%x\r\n",start[0],start[1]);
        return 0;
    }
    else
    {
        printf("0x55aa stored like this:0x%x%x\r\n",start[0],start[1]);
        return 1;
    }
}
void main(int argc, char *argv[])
{
    if(argc == 1)
        is_little_endian()?printf("is_little_endian\r\n"):printf("is_big_endian\r\n");
    else
        printf("Only need one argument!\r\n");
}
